The \f3Stack<Type>\f1 class implements a conventional first-in, last-out datastructure that holds a user-specified data type. All memory management and
initialization is encapsulated and performed by the class constructors and
member functions. Stack objects can be either static-sized or dynamic. Stacks
are, by default, dynamic in nature. A static-sized stack object is selected by
setting the growth allocation size to zero or by passing in a pointer to a
block of user-supplied storage to the constructor. If a stack is of static size
and an operation is performed that requires more storage, an
\f3\f3Error\f1\f1
exception is raised.
.SH Base Classes
Stack,
.SH Friend Classes
None
.SH Constructors
.TP
\f3Stack<Type> ();\f1
Creates an empty stack of the specified type.
.TP
\f3Stack<Type> \f3(unisgned long \f2number\f3);\f1
Allocates enough storage for a stack of a specific type to hold
number
of elements.
.TP
\f3Stack<Type> (const Stack<Type>& stk\f3);\f1
Duplicates the size and value of a stack object
stk .
.TP
\f3Stack<Type> (void* \f2storage\f3, unsigned long \f2number\f3);\f1
Creates a static-sized stack object for
number
of elements whose storage
storage
is provided by the user. If an object of this type attempts to grow
dynamically or the programmer invokes the
resize
member function, an
\f3\f3Error\f1\f1
exception is raised.
.SH Member Functions
.TP
inline long capacity () const;
Returns the maximum number of elements the stack can contain.
.TP
inline void clear ();
Sets the number of elements in the stack to zero.
.TP
\f3Boolean find (const Type& value\f3);\f1
Searches the stack for
value .
If
value
is found, this function returns
TRUE ;
otherwise, this function returns
FALSE .
.TP
inline Boolean is_empty () const;
Returns
TRUE
if the stack has no elements; otherwise, this function returns